package cn.edu.scau.cmi.dengzejun.chapter10;

import java.io.*;

public class Example1 {
	public static void main(String args[]) {
		File f = new File(".");
		System.out.println(f.getName()+" is read ? "+f.canRead());
		System.out.println("the length of "+f.getName()+" is "+f.length());
		System.out.println("the absolute path of "+f.getName()+" is "+f.getAbsolutePath());
		File file = new File("new.txt");
		System.out.println("the new file is "+file.getName());
		if (!file.exists()) {
			try {
				file.createNewFile();
				System.out.println("success!");
			}catch(IOException e) {
				
			}
		}
		return;
	}
}
